import * as appApi from "../../api/app";

const user = {
    state: {
        auth: {
            menu: [],
            resource: []
        }
    },
    mutations: {
        setAuth (state, data) {
            state.auth = data
        }
    },
    actions: {
        userAuth ({commit}) {
            appApi.auth().then((data) => {
                commit('setAuth', data)
                commit('updateMenulist')
            })
        }
    }
};

export default user;
